// 时间转换
export const time = {
    getTime(data) {
        var Time = new Date(data * 1000);
        var year = Time.getFullYear();
        var month = Time.getMonth() + 1;
        if (month > 0 && month < 10) {
            month = `0${month}`
        }
        var date = Time.getDate();
        if (date > 0 && date < 10) {
            date = `0${date}`
        }
        return `${year}-${month}-${date}`
    },
    getallTime(data) {
        var Time = new Date(data * 1000);
        var year = Time.getFullYear();
        var month = Time.getMonth() + 1;
        var date = Time.getDate();
        var hours = Time.getHours()
        var minutes = Time.getMinutes()
        var seconds = Time.getSeconds()
        if (month < 10) {
            month = `0${month}`
        }
        if (date < 10) {
            date = `0${date}`
        }
        if (hours < 10) {
            hours = `0${hours}`
        }
        if (minutes < 10) {
            minutes = `0${minutes}`
        }
        return `${year}-${month}-${date} ${hours}:${minutes}`
    },
    now() {
        var now = new Date()
        now = Date.parse(now)
        return now
    }
}